<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

	<head>
		<title>Gimme Opacity Tests</title>

		<script type = "text/javascript" src = "../jsunit/app/jsUnitCore.js"></script>
		<script type = "text/javascript" src = "../utils/jsunit/jsUnitHelperFunctions.js"></script>
		<script type = "text/javascript" src = "../build/debug/gimme.js"></script>
		
		<script type = "text/javascript">
			var pageHTML;
			function setUpPage()
			{
				pageHTML = document.body.innerHTML;
				setUpPageStatus = 'complete';
			}
			function setUp()
			{
				document.body.innerHTML = pageHTML;				
			}
			
			function test_getOpacityOfUnsetElement()
			{
				var opacity = g('#div1').get_style('opacity');
				assertEquals('Opacity is not 1', 1, Number(opacity));
			}
			
			function test_getOpacityOfElementSetTo50Percent()
			{
				var opacity = g('#div2').get_style('opacity');
				assertEquals('Opacity is not .5', .5, Number(opacity));
			}
			
			function test_setOpacityTo75Percent()
			{
				var gObj = g('#div1').set_style({ opacity: .75 });
				assertEquals('Opacity is not .75', .75, Number(gObj.get_style('opacity')));
			}
			
			function test_setOpacityToZero()
			{
				var gObj = g('#div2').set_style({ opacity: 0 });
				assertEquals('Opacity is not 0', 0, Number(gObj.get_style('opacity')));
			}
		</script>
	</head>

	<body>
		<h1>Gimme Opacity Tests</h1>

		<div id = "div1">DIV1</div>
		<div id = "div2" style = "opacity: .5; zoom: 1; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=50)';">DIV2</div>
	</body>

</html>